/**
 * 类型声明文件
 */
import type {
  CreateAxiosDefaults,
  InternalAxiosRequestConfig,
  AxiosResponse,
  AxiosRequestConfig
} from 'axios'

export interface RequestInterceptors {
  requestInterceptor?: (config: InternalAxiosRequestConfig2) => InternalAxiosRequestConfig2
  requestInterceptorCatch?: (error: any) => any
  responseInterceptor?: (config: AxiosResponse2) => AxiosResponse2
  responseInterceptorCatch?: (error: any) => any
}
// 自定义配置
interface customOpts {
  interceptors?: RequestInterceptors
  showLoading?: boolean
}
// 扩展InternalAxiosRequestConfig
export interface InternalAxiosRequestConfig2 extends InternalAxiosRequestConfig, customOpts {}
// 扩展CreateAxiosDefaults
export interface RequestConfig extends CreateAxiosDefaults, customOpts {}
// 扩展AxiosRequestConfig
export interface AxiosRequestConfig2 extends AxiosRequestConfig, customOpts {}
// 扩展AxiosResponse
export interface AxiosResponse2 extends AxiosResponse {
  config: InternalAxiosRequestConfig2
}
